﻿@using ZR.CodeGenerator
@using ZR.Model.System.Generate
@*@model ZR.CodeGenerator.Model.GenerateDto;*@
@{
    var genTable = Model.GenTable;
    var subTableOptions = Model.SubTableOptions;
    var options = Model.GenOptions;
    var replaceDto = Model.ReplaceDto;
}
@foreach(var column in genTable.Columns)
{
    var labelName = "";
    var columnName = "";
    var vModelLabel = "v-model";
    if(column.IsQuery == true)
    {
        columnName = column.CsharpFieldFl;

        if(column.FieldDesc != "")
        {
            labelName = column.FieldDesc;
        }
	    else
        {
            labelName = column.CsharpFieldFl;
        }
        if(column.CsharpType == "int" || column.CsharpType == "long")
        {
            vModelLabel = "v-model.number";
        }

        if (column.HtmlType == "datetime")
        {
            <el-form-item label="@labelName">
                <el-date-picker v-model="dateRange@(column.CsharpField)" style="width: 240px" value-format="yyyy-MM-dd" type="daterange" range-separator="-"
                                start-placeholder="开始日期" end-placeholder="结束日期" placeholder="请选择@(labelName)" :picker-options="{ firstDayOfWeek: 1}" clearable></el-date-picker>
            </el-form-item>
        }
        else if (column.HtmlType == "select" || column.HtmlType == "radio")
        {
            <el-form-item label="@(labelName)" prop="@(columnName)">
                <el-select v-model="queryParams.@(columnName)" placeholder="请选择@(labelName)" clearable >
                  <el-option v-for="item in @(column.DictType != ""?column.DictType:$"{column.CsharpFieldFl}Options")" :key="item.dictValue" :label="item.dictLabel" :value="item.dictValue"></el-option>
                </el-select>
          </el-form-item>
        }
        else
        {
              <el-form-item label="@(labelName)" prop="@(columnName)">
                <el-input @(vModelLabel) ="queryParams.@(columnName)" placeholder="请输入@(labelName)" clearable />
              </el-form-item>
        }
    }
}